#include<stdio.h>
/*********Begin*********/
int max(int* p, int n)
{
    int i, t;
    for (i = n - 1; i >= 0; i--)
        if (p[i] < p[i + 1])
        {
            t = p[i];
            p[i] = p[i + 1];
            p[i + 1] = t;
        }
    return p[0];
}
int main(void)
{
    int n, s[110];
    scanf("%d", &n);
    for (int i = 0; i < n; i++)
        scanf("%d", &s[i]);
    int ans;
    ans = max(s, n);
    printf("%d", ans);
    return 0;
}




